var SMSInsertContentType = [{
	"name": "插入姓名",
	"content": "[%NAME%]",
}, {
	"name": "插入时间",
	"content": "[%DATE%]",
}, {
	"name": "插入费用",
	"content": "[%FEE%]",
}, ];

function IniSMSContent(displayNAME) {
	var content = "";
	var displayID = "";
	displayID = "input_" + displayNAME;
	content = "<div style=\"margin-top:10px;\">";
	content += "<label>短信内容</label>";
	content+="<div style=\"margin:5px;\">";
	for(var i = 0; i < SMSInsertContentType.length; i++) {
		content += "<input type=\"button\" class=\"easyui-linkbutton\" onclick=\"insertText('" + displayID + "','" + SMSInsertContentType[i].content + "')\" value='" + SMSInsertContentType[i].name + "'></input>";
	}
	content+="</div>";
	content += "<input id='" + displayID + "' class=\"easyui-textbox\" data-options=\"multiline:true\" type=\"text\" name='" + displayNAME + "' style=\"width:100%;height:100px\"></input>";
	content += "</div>";
	return content;
}

function insertText(objname, str) {
	var s="#"+objname;
	var obj = $("#smsContent").find(s);
	console.log(obj);
	var _val = obj.textbox('getValue');
	var s = _val + str;
	obj.textbox('setValue', s);
}

var SMSType = [{
	"text": "生日短信",
	"id": "0",
	"group":"定时短信",
}, {
	"text": "合同短信",
	"id": "1",
	"group":"定时短信",
}, {
	"text": "群发短信",
	"id": "2",
	"group":"即时短信",
}, 
{
	"text": "即时发送",
	"id": "3",
	"group":"即时短信",
},];

function SMSTypeChange(_val)
{
	for(var i=0;i<SMSType.length;i++)
	{
		if(SMSType[i].id==_val)
		{
			return SMSType[i].text;
		}
	}
	
}
